package com.whq.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.whq.dao.CouponMapper;
import com.whq.entity.Coupon;
import com.whq.service.CouponService;

@Service(value = "tdCouponService")
public class CouponServiceImpl implements CouponService {

    @Autowired
    private CouponMapper<Coupon>tdCouponMapper;
    
    @Override
    public Integer insertSelective(Coupon tdCoupon) throws Exception {
           return this.tdCouponMapper.insertSelective(tdCoupon);
        }

    @Override
    public Integer insertBatch(List<Coupon> tdCoupon) throws Exception {
           return this.tdCouponMapper.insertBatch(tdCoupon) ;
        }

    @Override
    public Integer deleteByPrimaryKey(Object id) {
            return this.tdCouponMapper.deleteByPrimaryKey(id);
    }

    public Integer deleteBatchByPrimaryKey(List<Object> ids) {
           return this.tdCouponMapper.deleteBatchByPrimaryKey(ids);
    }

    @Override
    public Integer updateByPrimaryKeySelective(Coupon tdCoupon) {
           return this.tdCouponMapper.updateByPrimaryKeySelective(tdCoupon);
    }

    @Override
    public Coupon findById(Object id) {
           return (Coupon) this.tdCouponMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Coupon> selectByCondition(Coupon tdCoupon) {
           return (List<Coupon>) this.tdCouponMapper.selectByCondition(tdCoupon);
    }

    @Override
    public Integer selectCountByCondition(Coupon tdCoupon) {
           return  this.tdCouponMapper.selectCountByCondition(tdCoupon);
    }

}
